<?php

class Form_Admin_Client extends Form_Custom_General {

    public function init() {
		
		$clnt_first_name = $this->createElement("text", "clnt_first_name")
				->setRequired(TRUE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "Please enter first name")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"First Name"));
        $this->addElement($clnt_first_name);
		
		$clnt_middle_name = $this->createElement("text", "clnt_middle_name")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Middle Name"));
        $this->addElement($clnt_middle_name);
		
		$clnt_last_name = $this->createElement("text", "clnt_last_name")
				->setRequired(TRUE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "Please enter last name")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Last Name"));
        $this->addElement($clnt_last_name);
		
		$clnt_dob = $this->createElement("text", "clnt_dob")
				->setRequired(TRUE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "Please enter date of birth")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control form_datetime","placeholder"=>"",'readonly' => 'true'));
        $this->addElement($clnt_dob);
		
		$clnt_email = $this->createElement('text', 'clnt_email')
                ->setRequired(TRUE)
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Email address should not be blank.')))
                ->addValidator(new Zend_Validate_EmailAddress())
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                    new Zend_Filter_StringToLower()
                ))
                ->setAttribs(Array('class' => "form-control"));
        $clnt_email->getValidator('emailAddress')->setMessage("Email address is not valid.", Zend_Validate_EmailAddress::INVALID_FORMAT);
        $this->addElement($clnt_email);
		
		$clnt_phone = $this->createElement("text", "clnt_phone")
				->setRequired(TRUE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "Please enter phone number")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Phone Number"));
        $this->addElement($clnt_phone);
		
		$clnt_site = $this->createElement("text", "clnt_site")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Site"));
        $this->addElement($clnt_site);
		
		$clnt_company = $this->createElement("select", "clnt_company")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"","placeholder"=>"Company","width"=>"100%"));
        $this->addElement($clnt_company);
		
		$clnt_position = $this->createElement("text", "clnt_position")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Client Position"));
        $this->addElement($clnt_position);
		
		$clnt_comment = $this->createElement("textarea", "clnt_comment")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "r")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","cols" => "15", "rows" => "4","placeholder"=>"Comment"));
        $this->addElement($clnt_comment);
		
		$clnt_adrline1 = $this->createElement("text", "clnt_adrline1")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Adrline1"));
        $this->addElement($clnt_adrline1);
		
		$clnt_adrline2 = $this->createElement("text", "clnt_adrline2")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Adrline2"));
        $this->addElement($clnt_adrline2);

		$clnt_adrline3 = $this->createElement("text", "clnt_adrline3")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Adrline3"));
        $this->addElement($clnt_adrline3);
		
		$clnt_street = $this->createElement("text", "clnt_street")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Street"));
        $this->addElement($clnt_street);
		
		$clnt_postal = $this->createElement("text", "clnt_postal")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Postal"));
        $this->addElement($clnt_postal);
		
		$clnt_city = $this->createElement("text", "clnt_city")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"City"));
        $this->addElement($clnt_city);
		
		$clnt_country = $this->createElement("text", "clnt_country")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Country"));
        $this->addElement($clnt_country);
		
		$clnt_available_to_everyone = $this->createElement("text", "clnt_available_to_everyone")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>""));
        $this->addElement($clnt_available_to_everyone);
		
		$clnt_type = $this->createElement("select", "clnt_type")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"","placeholder"=>""));
        $this->addElement($clnt_type);
		
		$clnt_responsible = $this->createElement("text", "clnt_responsible")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Responsible"));
        $this->addElement($clnt_responsible);
		
		$clnt_source = $this->createElement("select", "clnt_source")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"","placeholder"=>""));
        $this->addElement($clnt_source);
		
		$clnt_description = $this->createElement("textarea", "clnt_description")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","cols" => "15", "rows" => "4","placeholder"=>"Description"));
        $this->addElement($clnt_description);
		
        $clnt_addedby = $this->createElement('text', 'clnt_addedby')
               ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array('class' => "form-control", "readonly"=>"readonly", "placeholder" => ""));
        $this->addElement($clnt_addedby);
        
        $clnt_updatedby = $this->createElement('text', 'clnt_updatedby')
               ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array('class' => "form-control","readonly"=>"readonly", "placeholder" => ""));
        $this->addElement($clnt_updatedby);
		
		$clnt_status = $this->createElement("select", "clnt_status")
				->setRequired(TRUE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "Please enter status")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Status"));
		$this->addElement($clnt_status);
		
		$submit = $this->createElement('submit', 'Save')
                ->setAttribs(Array('title' => "Save changes", 'class' => "btn-glow primary"));
        $this->addElement($submit);

        $reset = $this->createElement('reset', 'Reset')
                ->setAttribs(Array('title' => "Save changes and continue to edit", 'class' => "btn-glow primary"));
        $this->addElement($reset);
    }
}